home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_00 / powdemo7.bas < prev    next >
BASIC Source File  |  1995-01-01  |  1KB  |  65 lines

  1. $link "pow.pbl"
  2. $include "pow.inc"
  3.  
  4. 'POW! Demo #7 - Let's reload the SAMPLE.VOC file we created with
  5. 'POWDEMO6 and mess around with it a bit.  Compile this to a standalone
  6. '.EXE file and run from the DOS prompt.
  7.  
  8. q%=pbvhost
  9. shift right q%,5
  10. if q% and 1 then
  11.     print:print "Please run from a standalone .EXE only."
  12.      end
  13. end if
  14.  
  15. if sbdetect=0 then
  16.     print "Soundblaster required!":end
  17. end if
  18.  
  19.  
  20. e$=environ$("BLASTER")
  21.  
  22. if e$<>"" then
  23.     bp%=instr(e$,"A")  'Base port
  24.     if bp%<>0 then
  25.          bp$="&h"+mid$(e$,bp%+1,3)
  26.           sbsetbase val(bp$)
  27.      end if
  28.      i%=instr(e$,"I")   'Interrupt number
  29.      if i%<>0 then
  30.          i$=mid$(e$,i%+1,1)
  31.           sbsetint val(i$)
  32.      end if
  33.      d%=instr(e$,"D")   'DMA number
  34.      if d%<>0 then
  35.          d$=mid$(e$,d%+1,1)
  36.           sbsetdma val(d$)
  37.      end if
  38. end if
  39.  
  40.  
  41. sv$="sample.voc"
  42. if dir$(sv$)="" then
  43.     line input "Path to SAMPLE.VOC: ";pth$
  44.      if right$(pth$,1)<>"\" then pth$=pth$+"\"
  45.      sv$=pth$+sv$
  46.      if dir$(sv$)="" then end
  47. end if
  48.  
  49. sbreset 'Reset the SB's DAC
  50. redim holdsample%(1:8192)
  51. sbarrayload sv$,ln%,sr%,holdsample%(1)  'Load the .VOC
  52.  
  53. 'OK let's make some word salad... care for some roquefort
  54. 'with that? ... press any key to cancel this mess.
  55.  
  56. randomize timer
  57. do
  58.     sr%=int(8000*rnd(1))+4000
  59.      sp%=int(8192*rnd(1))+1
  60.      dly%=int(1000*rnd(1))+1
  61.      sbarrayplay 16385-(sp%*2),sr%,holdsample%(sp%)
  62.      sbdelay dly%
  63. loop while inkey$=""
  64. sbreset
  65.